home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / utils / file / managers / mc-3.2 / mc-3 / mc-3.2.1 / src / tty.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-17  |  3.0 KB  |  142 lines

  1. /* This file takes care of loading ncurses or slang */
  2.  
  3. int got_interrupt ();
  4.  
  5. #ifdef HAVE_SLANG
  6. #   include "../slang/slang.h"
  7. #   include "../slang/slcurses.h"
  8. #   include "myslang.h"
  9.  
  10. #   define TTY_H_DONE
  11. #else
  12. #   define enable_interrupt_key()
  13. #   define disable_interrupt_key()
  14. #   define slang_shutdown()
  15. #   define slang_done_screen()
  16. #   define slang_init()
  17. #   define slang_init_screen()
  18. #   define slang_init_tty()
  19. #   define slang_done_tty();
  20. #   define acs()
  21. #   define noacs()
  22. #   define one_vline() addch (slow_terminal ? ' ' : ACS_VLINE)
  23. #   define one_hline() addch (slow_terminal ? ' ' : ACS_HLINE)
  24. #endif
  25.  
  26. #if !defined(TTY_H_DONE) && defined(USE_NCURSES)
  27.     /* This is required since ncurses 1.8.6 and newer changed the name of */
  28.     /* the include files (argh!) */
  29. #    ifdef RENAMED_NCURSES
  30. #        include <curses.h>
  31. #    else
  32. #        include <ncurses.h>
  33. #    endif
  34. #    ifdef INCLUDE_TERM
  35. #        include <term.h>
  36. #        define TERM_INCLUDED 1
  37. #    endif
  38. #    define TTY_H_DONE
  39. #endif
  40.  
  41. #if !defined(TTY_H_DONE) && defined(USE_BSD_CURSES)
  42.  
  43.     /* This is only to let people that don't want to install ncurses */
  44.     /* run this nice program; they get what they deserve.            */
  45.  
  46.     /* Ultrix has a better curses: cursesX */
  47. #   ifdef ultrix
  48. #       include <cursesX.h>
  49. #   else
  50. #       include <curses.h>
  51. #   endif
  52.  
  53. #   ifndef ACS_VLINE
  54. #       define ACS_VLINE '|'
  55. #   endif
  56.  
  57. #   ifndef ACS_HLINE
  58. #       define ACS_HLINE '-'
  59. #   endif
  60.  
  61. #   ifndef ACS_ULCORNER
  62. #       define ACS_ULCORNER '+'
  63. #   endif
  64.  
  65. #   ifndef ACS_LLCORNER
  66. #       define ACS_LLCORNER '+'
  67. #   endif
  68.  
  69. #   ifndef ACS_URCORNER
  70. #       define ACS_URCORNER '+'
  71. #   endif
  72.  
  73. #   ifndef ACS_LRCORNER
  74. #       define ACS_LRCORNER '+'
  75. #   endif
  76.  
  77. #   ifndef ACS_LTEE
  78. #       define ACS_LTEE '+'
  79. #   endif
  80.  
  81. #   ifndef KEY_BACKSPACE
  82. #       define KEY_BACKSPACE 0
  83. #   endif
  84.  
  85. #   ifndef KEY_END
  86. #       define KEY_END 0
  87. #   endif
  88.  
  89. #   define ACS_MAP(x) '*'
  90.  
  91. #   define NO_COLOR_SUPPORT
  92. #   define untouchwin(win) 
  93. #   define xgetch x_getch
  94. #   define wtouchln(win,b,c,d) touchwin(win)
  95. #   define derwin(win,x,y,z,w) win
  96. #   define wscrl(win,n)
  97. #   define TTY_H_DONE
  98. #endif
  99.  
  100. #if !defined(TTY_H_DONE) && defined(USE_SYSV_CURSES)
  101. #   include <curses.h>
  102. #   ifdef INCLUDE_TERM
  103. #       include <term.h>
  104.         /* Ugly hack to avoid name space pollution */
  105. #       undef cols
  106. #       undef lines
  107. #       undef buttons
  108.  
  109. #       define TERM_INCLUDED 1
  110. #   endif
  111.  
  112. #   if defined(sparc) || defined(__sgi) || defined(_SGI_SOURCE)
  113.         /* We are dealing with Solaris or SGI buggy curses :-) */
  114. #       define BUGGY_CURSES 1
  115. #   endif
  116. #   if defined(mips) && defined(sgi)
  117.         /* GNU C compiler, buggy sgi */
  118. #       define BUGGY_CURSES 1
  119. #   endif
  120.  
  121. #   ifdef __osf__
  122. #       define untouchwin(win)
  123. #   endif
  124.  
  125. #endif /* USE_SYSV_CURSES */
  126.  
  127. #ifdef NO_COLOR_SUPPORT
  128. #   define COLOR_PAIR(x) 1
  129.  
  130. enum {
  131.   COLOR_BLACK, COLOR_RED,     COLOR_GREEN, COLOR_YELLOW,
  132.   COLOR_BLUE,  COLOR_MAGENTA, COLOR_CYAN,  COLOR_WHITE
  133. };
  134.  
  135. int init_pair (int, int, int);
  136.  
  137. #endif
  138.  
  139. #define KEY_KP_ADD    4001
  140. #define KEY_KP_SUBTRACT    4002
  141. #define KEY_KP_MULTIPLY    4003
  142.